Repository navigation
Sign out when login skips a workspace - #2
Merged
Merged
Conversation
Continuing past Plain's workspace step issues a token that cannot load the app, and the next sign-in replays that session. Drop the local user and OIDC state, and send prompt=login on the next attempt so the workspace step is shown again. Do the same when the callback bounces back to the sign-in page. Co-authored-by: Mathias Vagni <mattvagni@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plain's sign-in screen asks which workspace to use, but it does not require an answer. Continuing without one issues a token with no workspace. The app then cannot load, and the next click on Sign in replays that same session, so the person lands back on the login page. Incognito works because it has no saved session.
This signs them out when that happens and clears the saved session so the next attempt starts clean.
myWorkspace(ormyUser) is null after sign-in, the app removes the user, stops silent renew, and deletes oidc state fromsessionStorageandlocalStorage.clearStaleStateonly drops entries older than 15 minutes, which does not break this loop.prompt=loginandmax_age=0, so Plain does not reuse the session that skipped the workspace. Plain's discovery document has no end-session endpoint to call. A later sign-in that does have a workspace clears that flag.sessionStoragewith the user, matching the rest of the session. OlderlocalStoragekeys are still wiped.